<template>
  <div class="hello">
    <Button>添加</Button>
    <h1>{{ msg }}
      <h2>
        this is h2
      </h2>
    </h1>
    <Button v-on:click1="onClick2">确认</Button>
    <h2 class="fz-40">Essential Links</h2>
    <div class="tip fz-30 w-200">
      this is tip
    </div>
    <div style="margin:30px 300px;">
      <Button v-on:click1="onClick" type="error">删除</Button>
    </div>
    <Button @click="onClick" type="info" ghost>Info</Button>
    <Button type="success">Success</Button>
    <Button type="warning">Warning</Button>
    <Button type="error">Error</Button>
    <Button shape="circle" icon="ios-search"></Button>
    <Button icon="ios-search">Search</Button>

    <Input v-model="value" placeholder="Enter something..." style="width: 300px" />
    <Input v-model="value1" placeholder="Enter something..." style="width: 300px" />

    <RadioGroup v-model="button1" type="button">
      <Radio label="北京"></Radio>
      <Radio label="上海"></Radio>
      <Radio label="深圳"></Radio>
      <Radio label="杭州"></Radio>
    </RadioGroup>

    <CheckboxGroup v-model="fruit">
      <Checkbox label="香蕉"></Checkbox>
      <Checkbox label="苹果"></Checkbox>
      <Checkbox label="西瓜"></Checkbox>
    </CheckboxGroup>

    <Col span="12">
    <DatePicker type="date" placeholder="Select date" style="width: 200px" @on-change="onDateChange"></DatePicker>
    </Col>

    <router-link to="/login">Go to Login</router-link>
  </div>
</template>

<script>
// import Button from './Button.vue'

export default {
  name: "HelloWorld",
  components: {
    // Button
  },
  data() {
    return {
      msg: "Welcome to Your Vue.js App",
      value: "",
      value1: "",
      button1: "深圳",
      fruit: []
    };
  },
  methods: {
    onClick(e) {
      console.log(
        "-------------",
        this.value,
        this.value1,
        this.button1,
        this.fruit
      );
      //this.$router.push('login')
      this.$router.push({ path: "login", query: { id: '123',name:'abc' } });
    },
    onClick2(e) {
      console.log("this is click2");
    },
    onDateChange(a, b) {
      console.log(a, b);
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<!--<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>-->

<style scoped lang="scss">
$width: 400px;
$height: 200px;

@function fn ($height) {
  @return $height / 3;
}

@mixin rounded-corners($radius) {
  -moz-border-radius: $radius;
  -webkit-border-radius: $radius;
  border-radius: $radius;
}

.hello {
  h1 {
    color: red;
    h2 {
      color: blue;
    }
    &:hover {
      color: black;
    }
  }
  h2 {
    color: green;
  }
  &-tip {
    color: greenyellow;
    font: {
      weight: bold;
      style: italic;
    }
    @include rounded-corners(30px);
    width: $width;
    height: fn(900px);
    background: gray;
    @if $width > 200px {
      color: rebeccapurple;
    }
  }
}
</style>
